<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %>
<div class="block">
    <div class="block_head">
        <div class="bheadl"></div>
        <div class="bheadr"></div>
        
        <h2>Groups</h2>
        
        <ul>
            <li>
                <html:link action="/admin/group.do" >
                    Add Group
                </html:link>
            </li>
        </ul>
    </div>
    <!-- .block_head ends -->
    
    <div class="block_content clearfix">
        <logic:notEmpty name="errorMessage" >
            <div class="message errormsg"><p><bean:write name="errorMessage"/></p></div>
        </logic:notEmpty>
        <logic:notEmpty name="successMessage" >
            <div class="message success"><p><bean:write name="successMessage"/></p></div>
        </logic:notEmpty>
        <p>You can create custom permissions for different users by assigning them to groups in the Users > Manage Users area. Then you can Edit Permissions for each group and control what modules a group can have.</p>
            <table cellpadding="0" cellspacing="0" width="100%" class="sortable">
                
                <thead>
                    <tr>
                        <th>Permissions</th>
                        <td>&nbsp;</td>
                    </tr>
                </thead>
                
                <tbody>
                    <logic:empty name="groupList">
                        <tr>
                            <td class="align-center" colspan="2">There are no groups</td>
                        </tr>
                    </logic:empty>
                    <logic:notEmpty name="groupList">
                        <logic:iterate id="group" name="groupList">
                            <tr>
                                <td>     
                                    <bean:write name="group" property="groupName"/>
                                </td>
                                <td class="delete">
                                    <logic:equal name="group" property="groupID" value="1">
                                        The Admin group has access to everything
                                    </logic:equal>
                                    <logic:notEqual name="group" property="groupID" value="1">
                                        <html:link action="/admin/permission.do" paramId="groupID" paramName="group" paramProperty="groupID">
                                            Edit Permissions
                                        </html:link>
                                    </logic:notEqual>
                                </td>
                            </tr>
                        </logic:iterate>
                    </logic:notEmpty>
                </tbody>
                
            </table>
    </div>
    <!-- .block_content ends -->
    
    <div class="bendl"></div>
    <div class="bendr"></div>
</div>
<!-- .block ends -->